const express = require('express')

const app = express()

const qs = require('querystring')

function bodyfun(req,res,next) {
    let sum = ''
    req.on('data',(dataStr) => {
        sum += dataStr
    })
    req.on('end',()=> {
        const body = qs.parse(sum)
        req.body = body
        next()
    })
}


module.exports = bodyfun